package com.qfedu.aunt.commons.pojo;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;

import java.util.Date;

/**
 * @author xiaobobo
 * @title: User
 * @projectName aunt_commons_2209
 * @description: TODO
 * @date 2022/10/31  9:46
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel("用户对象")
public class User {

    @ApiModelProperty(value = "用户id")
    @TableId(value = "user_id", type = IdType.ID_WORKER_STR)
    private String userId;
    @ApiModelProperty(value = "用户名字")
    private String username;
    @ApiModelProperty(value = "密码")
    private String password;
    @ApiModelProperty(value = "最后的登陆时间")
    private Date lastLoginTime;

    @TableLogic     //这个表示的是逻辑删除
    @ApiModelProperty(value = "数据状态")
    private Integer deleted;

    @Version
    @ApiModelProperty(value = "离线乐观锁")
    private Integer version;

    //创建时间
    @ApiModelProperty(value = "创建时间")
    @TableField(fill = FieldFill.INSERT)
    private Date createTime;

    //更新时间
    @ApiModelProperty(value = "更新时间")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;

}
